
set(MAKE_ARGS
    BUILD_TYPE=${CMAKE_BUILD_TYPE}
)

if (${PRODUCT_SIDE} STREQUAL device)
    list(APPEND MAKE_ARGS
        RUN_MODE=device
    )
    set(drv_dvpp_cmdlist_depends ts_agent)
    add_device_ko(LOCAL_MODULE drv_dvpp_cmdlist
        KO_SRC_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}
        USE_LOCAL_MODULE_BIN_FOLDER
        MAKE_ARGS ${MAKE_ARGS}
        TARGETE_DPENDS "${drv_dvpp_cmdlist_depends}")
else()
    list(APPEND MAKE_ARGS
        RUN_MODE=host
        KBUILD_MODPOST_WARN=1
    )
    set(drv_dvpp_cmdlist_depends drv_devdrv_host ts_agent drv_devmm_host)
    add_host_ko(LOCAL_MODULE drv_dvpp_cmdlist
        KO_SRC_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}
        USE_LOCAL_MODULE_BIN_FOLDER
        MAKE_ARGS ${MAKE_ARGS}
        TARGETE_DPENDS "${drv_dvpp_cmdlist_depends}")
    if ((${PRODUCT} STREQUAL ascend910B) OR (${PRODUCT} STREQUAL ascend920))
        add_subdirectory(vdrv)
    endif()
endif()
